package com.comcast.util;

import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;

public class ExceptionHelper {

	private ExceptionHelper() {
	}

	public static String getStackTraceAsString(Exception inException) {
	    String stackTrace = null;
	    try {
			StringWriter sw = new StringWriter();
		    PrintWriter pw = new PrintWriter(sw);
		    inException.printStackTrace(pw);
		    stackTrace = sw.toString();
			sw.close();
		    pw.close();
		} catch (IOException e) {
			// TODO - write to a log
			e.printStackTrace();
		}
	    return stackTrace;
	}

}
